<template>
  <div class="container">
    <div v-if="roleid == 1">
      <SelectionRules />
    </div>
    <div v-else>
      <class_evaluation />
    </div>
  </div>
</template>

<script>
import { mapState } from "vuex";
import { request } from "../request/http";
import SelectionRules from "./SelectionRules.vue";
import class_evaluation from "./class_evaluation";
export default {
  name: "home",
  components: {
    SelectionRules,
    class_evaluation,
  },
  data() {
    return {
      name: "",
      instructor_id: "",
      instructor_name: "",
      student_class: "",
      class_list: [],
    };
  },
  props: ["scholarship_id"],
  computed: {
    ...mapState({
      username: (state) => state.name,
      roleid: (state) => state.role,
      userid: (state) => state.user_id,
      userinfo: (state) => state.userinfo,
    }),
  },
  methods: {
    getUserInfo() {
      this.name = this.username;
      this.instructor_id = this.userinfo.instructor_id.id;
      this.instructor_name = this.userinfo.instructor_id.instructor;
    },
  },
  mounted() {
    this.getUserInfo();
  },
};
</script>
<style></style>
